﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Common.LuaEngine;

/// <summary>
/// 抽象脚本管理器
/// </summary>
namespace Common.Script
{
    public abstract class AbstractScriptManager
    {
        protected string m_Path = "";

        private MapleLuaEngine m_Luaframework;

        public AbstractScriptManager()
        {

        }

        protected MapleLuaEngine getInvocable(string path)
        {
            string scriptPath = System.IO.Directory.GetCurrentDirectory()+"\\Script" + path;
            m_Luaframework = null;

            if(m_Luaframework == null)
            {
                m_Path = scriptPath;
                m_Luaframework = new MapleLuaEngine();
                //加载文件
                m_Luaframework.LoadFile(scriptPath);
                //m_Luaframework.ExecuteFile(scriptPath)
            }

            return m_Luaframework;
        }
    }
}
